package core

import (
	"crypto/sha1"
	"encoding/hex"
	"gitee.com/gitee-go/core/common"
	"time"
)

func GenTimeVersinSha() (string, error) {
	tms := time.Now().Format(common.TimeFmtVer)
	ob := sha1.New()
	_, err := ob.Write([]byte(tms))
	if err != nil {
		return "", err
	}
	hsh := ob.Sum(nil)
	return hex.EncodeToString(hsh), nil
}
